<title>支付账户</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">

<script type="text/javascript" src="#(assets)/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="#(assets)/js/app.js"></script>
<script type="text/javascript" src="#(assets)/js/layer/layer.js"></script>
<style> 
	*{margin:0;padding:0;}
	body{font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";}
	li{list-style-type:none;}
	select,input{-webkit-appearance:none;border:0px;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);   
	}
</style>
#@checkToken()
<body bgcolor="#f4f5f9" style="margin:0px;">
<div align=center>
	<div align="left" style="background:#fff;height:50px;line-height:50px;width:100%;margin-top:20px;">
		<span style="margin-left:20px;" id="bank_card"></span>
	</div>
	<div align="left" style="background:#fff;height:50px;line-height:50px;width:100%;border-top:1px solid #f0f0f0">
		<span style="margin-left:20px;" id="bank_name"></span>
	</div>
	<div align="left" style="background:#fff;height:50px;line-height:50px;width:100%;border-top:1px solid #f0f0f0">
		<span style="margin-left:20px;" id="city"></span>
	</div>
	<div align="left" style="margin-top:20px;background:#fff;height:50px;line-height:50px;width:100%;">
		<span id="mobile" style="margin-left:20px;"></span>
	</div>
	<div id="codes" style="clear:both;background:#fff;height:50px;width:100%;border-top:1px solid #f0f0f0"> 
		<div align="left" style="float:left;line-height:50px;font-size:16px;width:65%;">
			<span style="margin-left:20px;">验证码：</span><input placeholder="输入验证码" id="code" style="height:50px;width:50%;font-size:16px;border:0px;" type="tel"  />
		</div>
		<input id="getcode" value="获取验证码" style="text-align:center;color:#fa3048;float:right;width:80px;line-height:50px;font-size:14px;margin-right:20px;">
	</div>
	<div id="next" style="position:fixed;bottom:100px;width:90%;margin-left:5%;color:#fa3048;border:2px solid #fa3048;height:40px;line-height:40px;border-radius:8px;">确认提交</div>
	 
</div>
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>  
<script>
	var ip_l=returnCitySN["cip"];
	var url ="#(path)/card/mainCard?token=#(session.token??)";
	$.getJSON(url, function(datainfo) {
		console.log(datainfo);
		$("#bank_card").html("卡号："+datainfo.data.card.bank_account.substring(0,4)+"****"+datainfo.data.card.bank_account.substring(15,19));
		$("#bank_name").html("开户行："+datainfo.data.card.bank_name);
		$("#city").html("开户行所在地："+datainfo.data.card.province+" "+datainfo.data.card.city);
		$("#mobile").html("手机号："+datainfo.data.card.mobile.substring(0,3)+"****"+datainfo.data.card.mobile.substring(5,9));
		$("#getcode").click(function(){
			$.getJSON("#(path)/card/unbindBankCard?token=#(session.token??)&id="+datainfo.data.card.id+"&code="+datainfo.data.card.code+"&ip="+ip_l, function(datainfo1) {
				if(datainfo1.code=='success'){
					layer.msg("验证码发送成功！",{icon:1,time:1000},function(){
						$("#next").click(function(){ 
							var sms = $("#code").val();
							if(sms==""){
								layer.msg("请填写验证码！",{icon:2,time:1000});
							}else{
								$.getJSON("#(path)/card/unbindBankCardAdvance?token=#(session.token??)&id="+datainfo1.data.id+"&ticket="+datainfo1.data.ticket+"&sms="+sms, function(datainfo2) {
									if(datainfo2.code=='success'){
										layer.msg(datainfo2.msg,{icon:1,time:1000},function(){
											window.location.href="#(path)/app/page/personal-account";
										}); 
									}else{
										layer.msg(datainfo2.msg,{icon:2,time:1000}); 
									}
								});
							}
						});
					});
				}else{
					layer.msg(datainfo1.msg,{icon:2,time:1000}); 
				}
			});
		});
		
	});

	var wait=60;  
	function waittime(o) {  
		if (wait == 0) {  
			o.removeAttribute("disabled");            
			o.value="获取验证码";  
			wait = 60;  
		} else {  
			o.setAttribute("disabled", true);  
			o.value="(" + wait + ")";  
			wait--;  
			setTimeout(function() {  
				waittime(o)  
			},  
			1000)  
		}  
	}  
</script>
</body>